<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddDepartmentIdIndexInTaskTable extends AbstractMigration
{
    public function up()
    {
        $this->table('task')
            ->addIndex(['department_id'], ['name' => 'idx_department'])
            ->addIndex(['entity_module_id'], ['name' => 'idx_entity_module_id'])
            ->save();
    }

    public function down()
    {
        $this->table('task')->removeIndexByName('idx_department')->removeIndexByName('idx_entity_module_id')->save();
    }
}
